<template>
  <div v-show="isLoading">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast">
      <i class="weui-loading weui-icon_toast"></i>
      <p class="weui-toast__content">加载中</p>
    </div>
  </div>
</template>

<script type="text/javascript">
  export default {
    computed: {
      isLoading () {
        return this.$store.state.im.isLoading
      }
    }
  }
</script>
<style scoped>
.weui-mask_transparent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 101;
    background-color: #000;
    opacity: 0.3;
}
.weui-toast {
    position: fixed;
    z-index: 5001;
    width: 7.6em;
    min-height: 7.6em;
    top: 180px;
    left: 50%;
    margin-left: -3.8em;
    background: rgba(17, 17, 17, .7);
    text-align: center;
    border-radius: 5px;
    color: #FFFFFF;
}
.weui-icon_toast.weui-loading {
    margin: 30px 0 0;
    width: 38px;
    height: 38px;
    vertical-align: baseline;
    display: inline-block;
}
.weui-toast__content {
    margin: 0 0 15px;
}
.weui-loading {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    -webkit-animation: weuiLoading 1s steps(12, end) infinite;
    -moz-animation: weuiLoading 1s steps(12, end) infinite;
    animation: weuiLoading 1s steps(12, end) infinite;
    background: transparent url("") no-repeat;
    background-size: 100%;
}
@-webkit-keyframes weuiLoading {
0% {
    -webkit-transform: rotate3d(0, 0, 1, 0deg);
            transform: rotate3d(0, 0, 1, 0deg);
}
100% {
    -webkit-transform: rotate3d(0, 0, 1, 360deg);
            transform: rotate3d(0, 0, 1, 360deg);
}
}
@-moz-keyframes weuiLoading {
0% {
    -moz-transform: rotate3d(0, 0, 1, 0deg);
         transform: rotate3d(0, 0, 1, 0deg);
}
100% {
    -moz-transform: rotate3d(0, 0, 1, 360deg);
         transform: rotate3d(0, 0, 1, 360deg);
}
}
@keyframes weuiLoading {
0% {
    -webkit-transform: rotate3d(0, 0, 1, 0deg);
       -moz-transform: rotate3d(0, 0, 1, 0deg);
            transform: rotate3d(0, 0, 1, 0deg);
}
100% {
    -webkit-transform: rotate3d(0, 0, 1, 360deg);
       -moz-transform: rotate3d(0, 0, 1, 360deg);
            transform: rotate3d(0, 0, 1, 360deg);
}
}
</style>
